<?php
/**
 * Sakam - framework oriented trough models
 * 
 * @category   	Sakam
 * @package    	Sakam_Data
 * @author		Carlos Gonzalez <zahualli@gmail.com>
 * @copyright  	Copyright (c) 2009-2010 Carlos Gonzalez
 */
class Sakam_Data_Table
{
	/**
	 * Database
	 * @var 	Sakam_Data_Database_Interface
	 * @access	protected
	 */
	protected $_database = null;
	
	/**
	 * Name of table
	 * @var string
	 * @access protected
	 */
	protected $_name = null;
	
	/**
	 * Fields of table
	 * @var array
	 * @access protected
	 */
	protected $_fields = array();
	
	/**
	 * Constructor of class
	 * @param	Sakam_Data_Database_Interface	$database
	 * @param	string							$name
	 * @access	public
	 * @return	void
	 */
	public function __construct( Sakam_Data_Database_Interface $database, $name )
	{
		$this->_database = $database;
		$this->_name 	 = $name;
	}
	/**
	 * Set Name
	 * @param	string	$name
	 * @return 	void
	 */
	public function setName( $name )
	{
		$this->_name = $name;	
	}
	
	/**
	 * get Name
	 * @return 	void
	 */
	public function getName()
	{
		return $this->_name;	
	}
	
	/**
	 * Add field to table
	 * @param	Sakam_Data_Field_Interface	$field
	 * @return 	bool
	 */
	public function addField( Sakam_Data_Field_Interface $field)
	{
		$this->_fields[] = $field;
	}
	
	/**
	 * Get SQL code
	 * @abstract
	 * @return 	strin
	 */
	public abstract function getSQL();
	
}